package Demo2;

public class Test {
    public static void main(String[] args) {
        Dog dog1=new Dog("旺财",22);
        Dog dog2=new Dog("旺财",22);
        System.out.println(dog1==dog2);
        System.out.println(dog1.equals(dog2));
        System.out.println("----------");
        System.out.println(dog1.hashCode());
        System.out.println(dog2.hashCode());
    }
    public static void func1(Animal animal){
        animal.eat();
    }

    public static void main1(String[] args) {
        func1(new Duck("唐老鸭",1));
        func1(new Dog("旺财",2));
    }
    public static void walk(IRunning iRunning){
        iRunning.run();
    }
}
